(**********************************************************************

    :Program.    StringForm.def
    :Contents.   string formatting procedures
    :Author.     Nicolas Benezan [bne]
    :Address.    Postwiesenstr. 2, D7000 Stuttgart 60
    :Phone.      711/333679
    :Copyright.  Public Domain
    :Language.   Modula-2
    :Translator. M2Amiga A+L V3.2d
    :History.    V1.0a [bne] 11.May.1989

**********************************************************************)

DEFINITION MODULE StringForm;

(* All procedures will truncate the string if it was too long to
   fit into the array boundaries. *)

PROCEDURE AppendBlanks(VAR String:ARRAY OF CHAR;
                           Width:INTEGER);
(*:Semantic.  Appends blanks to <String> until it has the length <Width>.
*)

PROCEDURE CenterAdjust(VAR String:ARRAY OF CHAR;
                           Width:INTEGER);
(*:Semantic.  Centers <String> within a field <Width> chars wide.
*)

PROCEDURE CutBlanks(VAR String:ARRAY OF CHAR);
(*:Semantic.  Cuts leading and trailing blanks.
*)

PROCEDURE EmptyString(String:ARRAY OF CHAR):BOOLEAN;
(*:Result.    TRUE, if <String> has the length 0 or consists of blanks only.
*)

PROCEDURE Indent(VAR String:ARRAY OF CHAR;
                     Margin:INTEGER);
(*:Semantic.  Inserts <Margin> blanks on the left side of <String>.
*)

PROCEDURE LeftInsertZeroes(VAR String:ARRAY OF CHAR;
                               Width:INTEGER);
(*:Semantic.  Inserts zeroes until the length of <String> is <Width>.
*)

PROCEDURE RightAdjust(VAR String:ARRAY OF CHAR;
                          Width:INTEGER);
(*:Semantic.  Right-adjusts <String> within a field <Width> chars wide.
*)

END StringForm.

